home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / qserch / qsearch.txt < prev   
Text File  |  1992-06-24  |  2KB  |  32 lines

  1. Declare Function FindString Lib "QSEARCH.DLL" (ByVal iSwitch As Integer, ByVal lpPathName As String, ByVal lpSearchString As String, ByVal hWnd As Integer) As Integer
  2.  
  3. Declare Function CopyFile Lib "QSEARCH.DLL" (ByVal lpSourcePath As String, ByVal lpDestPath As String, ByVal bSwitch As Integer) As Integer
  4.  
  5. Declare Function FindFile Lib "QSEARCH.DLL" (ByVal lpDrive As String, ByVal lpPattern As String, ByVal hWnd As Integer) As Integer
  6.  
  7. Sample usage:
  8.  
  9. List1.SetFocus
  10. h% = GetFocus()
  11. i% = FindString(1, "c:\dos\help.txt", "xcopy", h%)
  12.  
  13. 'searches "c:\dos\help.txt" and puts all lines containing "xcopy" in listbox with h% 'as hWnd. The first number is a switch for case sensitivity and line numbers. 0 = 
  14. 'case sensitive (-1 with line numbers), 1 = not sensitive (2 with line numbers) 
  15. 'It returns the number of lines containing searchstring or -1 if error opening 
  16. 'file.
  17.  
  18.  
  19. i% = CopyFile("c:\windows\winhelp.exe", "a:\winhelp.exe", 1)
  20.  
  21. 'Copies first argument to second argument. Third argument is a boolean switch, 
  22. '0 = copy without file info, 1 = copy with date and attribute. It returns 0 on 
  23. 'success or errors outlined in qsearch.h (at end of qsearch.c).
  24.  
  25.  
  26. List1.SetFocus
  27. h% = GetFocus()
  28. i% = FindFile("d", "*.txt", h%)
  29.  
  30. 'Finds files on "d" drive that match the pattern "*.txt" and places the matches in 'the list box with h% as hWnd. It returns matches found or -1 if error changing to 'selected drive. Note: No error checking on floppy drives. If door is open, return 'will be zero.
  31.  
  32.